home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / man / cat.n / exec.n < prev    next >
Text File  |  1995-07-25  |  12KB  |  265 lines

  1.  
  2.  
  3.  
  4.      eeeexxxxeeeecccc((((nnnn))))                     TTTTccccllll ((((7777....0000))))                     eeeexxxxeeeecccc((((nnnn))))
  5.  
  6.  
  7.  
  8.      _________________________________________________________________
  9.  
  10.      NNNNAAAAMMMMEEEE
  11.           exec - Invoke subprocess(es)
  12.  
  13.      SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  14.           eeeexxxxeeeecccc ?_s_w_i_t_c_h_e_s? _a_r_g ?_a_r_g ...?
  15.      _________________________________________________________________
  16.  
  17.  
  18.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  19.           This command treats its arguments as  the  specification  of
  20.           one or more subprocesses to execute.  The arguments take the
  21.           form of a standard shell pipeline where each _a_r_g becomes one
  22.           word  of  a  command,  and  each  distinct command becomes a
  23.           subprocess.
  24.  
  25.           If the initial arguments to eeeexxxxeeeecccc start with ---- then they  are  |
  26.           treated  as  command-line  switches  and are not part of the  |
  27.           pipeline  specification.    The   following   switches   are  |
  28.           currently supported:                                          |
  29.  
  30.           ----kkkkeeeeeeeeppppnnnneeeewwwwlllliiiinnnneeee                                                       ||
  31.                        Retains  a  trailing  newline in the pipeline's  |
  32.                        output.  Normally a trailing  newline  will  be  |
  33.                        deleted.                                         |
  34.  
  35.           --------                                                                 ||
  36.                        Marks   the  end  of  switches.   The  argument  |
  37.                        following this one will be treated as the first  |
  38.                        _a_r_g even if it starts with a ----....
  39.  
  40.           If an _a_r_g (or pair of _a_r_g's) has one of the forms  described
  41.           below  then  it is used by eeeexxxxeeeecccc to control the flow of input
  42.           and output among the subprocess(es).   Such  arguments  will
  43.           not  be  passed to the subprocess(es).  In forms such as ``<  |
  44.           _f_i_l_e_N_a_m_e'' _f_i_l_e_N_a_m_e may either be  in  a  separate  argument  |
  45.           from ``<'' or in the same argument with no intervening space  |
  46.           (i.e. ``<_f_i_l_e_N_a_m_e'').
  47.  
  48.           |              Separates distinct commands in the  pipeline.
  49.                          The  standard output of the preceding command
  50.                          will be piped into the standard input of  the
  51.                          next command.
  52.  
  53.           |&             Separates distinct commands in the  pipeline.
  54.                          Both  standard  output  and standard error of
  55.                          the preceding command will be piped into  the
  56.                          standard  input  of  the  next command.  This
  57.                          form of redirection overrides forms  such  as
  58.                          2> and >&.
  59.  
  60.  
  61.  
  62.  
  63.      Page 1                                          (printed 7/17/95)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      eeeexxxxeeeecccc((((nnnn))))                     TTTTccccllll ((((7777....0000))))                     eeeexxxxeeeecccc((((nnnn))))
  71.  
  72.  
  73.  
  74.           < _f_i_l_e_N_a_m_e     The file named by _f_i_l_e_N_a_m_e is opened and used
  75.                          as  the  standard input for the first command
  76.                          in the pipeline.
  77.  
  78.           <@ _f_i_l_e_I_d      _F_i_l_e_I_d must be the  identifier  for  an  open  |
  79.                          file,   such  as  the  return  value  from  a  |
  80.                          previous call to ooooppppeeeennnn.  It  is  used  as  the  |
  81.                          standard  input  for the first command in the  |
  82.                          pipeline.  _F_i_l_e_I_d must have been  opened  for  |
  83.                          reading.
  84.  
  85.           << _v_a_l_u_e       _V_a_l_u_e is passed to the first command  as  its
  86.                          standard input.
  87.  
  88.           > _f_i_l_e_N_a_m_e     Standard output  from  the  last  command  is
  89.                          redirected   to   the  file  named  _f_i_l_e_N_a_m_e,
  90.                          overwriting its previous contents.
  91.  
  92.           2> _f_i_l_e_N_a_m_e    Standard  error  from  all  commands  in  the  |
  93.                          pipeline  is  redirected  to  the  file named  |
  94.                          _f_i_l_e_N_a_m_e, overwriting its previous contents.   |
  95.  
  96.           >& _f_i_l_e_N_a_m_e                                                        ||
  97.                          Both  standard  output  from the last command  |
  98.                          and standard  error  from  all  commands  are  |
  99.                          redirected   to   the  file  named  _f_i_l_e_N_a_m_e,  |
  100.                          overwriting its previous contents.
  101.  
  102.           >> _f_i_l_e_N_a_m_e    Standard output  from  the  last  command  is
  103.                          redirected   to   the  file  named  _f_i_l_e_N_a_m_e,
  104.                          appending to it rather than overwriting it.
  105.  
  106.           2>> _f_i_l_e_N_a_m_e   Standard  error  from  all  commands  in  the  |
  107.                          pipeline  is  redirected  to  the  file named  |
  108.                          _f_i_l_e_N_a_m_e,  appending  to   it   rather   than  |
  109.                          overwriting it.                                |
  110.  
  111.           >>& _f_i_l_e_N_a_m_e                                                       ||
  112.                          Both  standard  output  from the last command  |
  113.                          and standard  error  from  all  commands  are  |
  114.                          redirected   to   the  file  named  _f_i_l_e_N_a_m_e,  |
  115.                          appending to it rather than overwriting it.    |
  116.  
  117.           >@ _f_i_l_e_I_d                                                          ||
  118.                          _F_i_l_e_I_d  must  be  the  identifier for an open  |
  119.                          file,  such  as  the  return  value  from   a  |
  120.                          previous  call to ooooppppeeeennnn.  Standard output from  |
  121.                          the last command is  redirected  to  _f_i_l_e_I_d's  |
  122.                          file,   which   must  have  been  opened  for  |
  123.                          writing.                                       |
  124.  
  125.           2>@ _f_i_l_e_I_d                                                         ||
  126.  
  127.  
  128.  
  129.      Page 2                                          (printed 7/17/95)
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.      eeeexxxxeeeecccc((((nnnn))))                     TTTTccccllll ((((7777....0000))))                     eeeexxxxeeeecccc((((nnnn))))
  137.  
  138.  
  139.  
  140.                          _F_i_l_e_I_d  must  be  the  identifier for an open  |
  141.                          file,  such  as  the  return  value  from   a  |
  142.                          previous  call  to ooooppppeeeennnn.  Standard error from  |
  143.                          all commands in the pipeline is redirected to  |
  144.                          _f_i_l_e_I_d's  file.   The  file  must  have  been  |
  145.                          opened for writing.                            |
  146.  
  147.           >&@ _f_i_l_e_I_d                                                         ||
  148.                          _F_i_l_e_I_d  must  be  the  identifier for an open  |
  149.                          file,  such  as  the  return  value  from   a  |
  150.                          previous  call to ooooppppeeeennnn.  Both standard output  |
  151.                          from the last command and standard error from  |
  152.                          all commands are redirected to _f_i_l_e_I_d's file.  |
  153.                          The file must have been opened for writing.
  154.  
  155.           If standard output has not been  redirected  then  the  eeeexxxxeeeecccc
  156.           command returns the standard output from the last command in
  157.           the pipeline.  If any of the commands in the  pipeline  exit
  158.           abnormally or are killed or suspended, then eeeexxxxeeeecccc will return
  159.           an error and the error message will include  the  pipeline's
  160.           output  followed  by  error messages describing the abnormal
  161.           terminations; the eeeerrrrrrrroooorrrrCCCCooooddddeeee variable will contain additional
  162.           information about the last abnormal termination encountered.
  163.           If any of the commands writes to its standard error file and
  164.           that  standard error isn't redirected, then eeeexxxxeeeecccc will return
  165.           an error;  the error message  will  include  the  pipeline's
  166.           standard   output,   followed  by  messages  about  abnormal
  167.           terminations  (if  any),  followed  by  the  standard  error
  168.           output.
  169.  
  170.           If the last character of the result or error  message  is  a
  171.           newline  then  that  character  is normally deleted from the
  172.           result or error message.  This is consistent with other  Tcl
  173.           return  values,  which  don't  normally  end  with newlines.  |
  174.           However, if ----kkkkeeeeeeeeppppnnnneeeewwwwlllliiiinnnneeee  is  specified  then  the  trailing  |
  175.           newline is retained.
  176.  
  177.           If standard input isn't redirected with ``<'' or  ``<<''  or
  178.           ``<@''  then the standard input for the first command in the
  179.           pipeline is taken from the  application's  current  standard
  180.           input.
  181.  
  182.           If the last _a_r_g is ``&'' then the pipeline will be  executed
  183.           in  background.  In this case the eeeexxxxeeeecccc command will return a  |
  184.           list whose elements are the process identifiers for  all  of  |
  185.           the  subprocesses in the pipeline.  The standard output from
  186.           the  last  command  in  the  pipeline   will   go   to   the
  187.           application's  standard output if it hasn't been redirected,
  188.           and error output from all of the commands  in  the  pipeline
  189.           will  go  to  the  application's  standard error file unless
  190.           redirected.
  191.  
  192.  
  193.  
  194.  
  195.      Page 3                                          (printed 7/17/95)
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.      eeeexxxxeeeecccc((((nnnn))))                     TTTTccccllll ((((7777....0000))))                     eeeexxxxeeeecccc((((nnnn))))
  203.  
  204.  
  205.  
  206.           The first word in each command is taken as the command name;
  207.           tilde-substitution  is  performed  on  it, and if the result
  208.           contains  no  slashes  then  the  directories  in  the  PATH
  209.           environment  variable  are searched for an executable by the
  210.           given name.  If the name contains a slash then it must refer
  211.           to  an  executable reachable from the current directory.  No
  212.           ``glob'' expansion or  other  shell-like  substitutions  are
  213.           performed on the arguments to commands.
  214.  
  215.  
  216.      KKKKEEEEYYYYWWWWOOOORRRRDDDDSSSS
  217.           execute, pipeline, redirection, subprocess
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.      Page 4                                          (printed 7/17/95)
  262.  
  263.  
  264.  
  265.